/**
 * Copyright (C) 2013 AirChina
 *
 * @description:
 * @version:v1.0.0
 */
package com.china.api.wechat.processor.main;

import java.util.Date;

/**
 * 单纯的图片消息
 * @author zhijun
 *
 */
public class ImageResponse extends Response {
	private String mediaId;

	public ImageResponse(String userId, String mediaId) {
		setUserId(userId);
		this.mediaId = mediaId;
	}

	@Override
	public String toXML() {
		Long l = new Date().getTime();
		StringBuilder sb = new StringBuilder();
		sb.append("<xml>");
		sb.append("<ToUserName><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></ToUserName>");
		sb.append("<FromUserName><![CDATA[");
		sb.append(getMyid());
		sb.append("]]></FromUserName>");
		sb.append("<CreateTime>");
		sb.append(l);
		sb.append("</CreateTime>");
		sb.append("<MsgType><![CDATA[image]]></MsgType>");
		sb.append("<Image><MediaId><![CDATA[");
		sb.append(mediaId);
		sb.append("]]></MediaId></Image>");
		sb.append("</xml>");
		return sb.toString();
	}

	public String getMediaId() {
		return mediaId;
	}
}
